#ifndef _STORAGE_H_
#define _STORAGE_H_

#include "gtmonitor.h"
#include "common.h"

struct stats_disk {
    //
    unsigned int major;
    //
    unsigned int minor;
    // device name
    char name[MAX_NAME_LEN];
    // # of reads completed
    unsigned long rd_ios;
    // # of reads merged
    unsigned long rd_merges;
    // # of sectors read (512 bytes/sector)
    unsigned long long rd_sectors;
    // # of milliseconds spent reading
    unsigned long rd_ticks;
    // # of writes completed
    unsigned long wr_ios;
    // # of writes merged
    unsigned long wr_merges;
    // # of sectors written
    unsigned long long wr_sectors;
    // # of milliseconds spent writing
    unsigned long wr_ticks;
    // # of I/Os currently in progress
    unsigned long ios_pgr;
    // # of milliseconds spent doing I/Os
    unsigned long tot_ticks;
    // weighted # of milliseconds spent doing I/Os
    unsigned long rq_ticks;
};

extern int is_dsk_recording;

void init_storage(void);

float get_storage_util(int);

long get_sdptot(int);

long get_sdctot(int);

int storage_dump();

void refresh_storage_util();

void get_storage_name(char *buf, int index);

float get_storage_total_util(void);

int get_storage_total(void);

void storage_cleanup(void);

#endif /* _STORAGE_H_ */
